package com.efesco.payroll.pay;

import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.SqlDataset;
import com.bstek.dorado.common.*;

/**
 * payAudit_datasetSumListener
 */
public class payAudit_datasetSumListener extends AbstractDatasetListener {
  public boolean beforeLoadData(Dataset dataset)
     throws Exception {
	DoradoContext context = DoradoContext.getContext();
	String selSend=context.getParameter("selected_send");
	
	SqlDataset ds = (SqlDataset) dataset;
	ds.setSql("select sum(f_3) the_sum from s_wa_data dt,s_wa_psn psn where "
			+"dt.wa_psn_id=psn.wa_psn_id and dt.dr=0 and dt.wa_send_id in ("+selSend+") and psn.if_local_send=1");
    System.out.println(ds.getSql());
    return true;
  }

  public void afterLoadData(Dataset dataset)
     throws Exception {

  }

}
